public class CustomerRepositoryImpl implements CustomerRepositoryLegacyMethods {
    //Repository for class CustomerRefactored is assigned automatically
	@Autowired
    CustomerRepositoryRefactored custRepRefactored;

    @Override
    public Customer save(Customer customer) {
    	//Customer has to be transferred to CustomerRefactored and back  
        CustomerRefactored c = custRepRefactored.save( customer.getCustomerRefactoredRef() );
        return c.getCustomer();
    }

    @Override
    public List<Customer> findAll() {
    	//Iterations over collections for transferring objects
        List<Customer> customerList = new ArrayList<Customer>();
        for ( CustomerRefactored customerRefactored : custRepRefactored.findAll() ){
            customerList.add( customerRefactored.getCustomer() );
        }
        return customerList;
    }

    @Override
    public Customer findOne(Long id) {
        CustomerRefactored customerRefactored = custRepRefactored.findOne(id);
        //Null checks have to be applied to avoid erros at runtime
        if (customerRefactored == null)
            return null;
        return customerRefactored.getCustomer();
    }

    @Override
    public void delete(Customer customer) {
        custRepRefactored.delete(  customer.getCustomerRefactoredRef() );
    }
}